package com.example.mqconsumer.consumer;


import com.example.common.config.Demo01Configuration;
import com.example.common.message.Demo01Message;
import com.example.common.message.Demo02Message;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Log4j2
@Component
@RabbitListener(queues = Demo02Message.QUEUE)
public class Demo02Consumer {

    @RabbitHandler
    public void onMessage(Demo02Message msg) {
        log.info(Demo02Message.QUEUE + "接收到数据:" + msg.getId());
    }
}
